#include <stdio.h>
#include <iostream>
#include "nature.h"

using namespace std;

Nature nature;

int main()
{
	extern Nature nature;
	srand(time(0));
	nature.function();
	nature.start();																	/*展示界面，输入开始时间，时间给到g_time*/
	for (nature.time_past = 0; nature.time_past <= nature.time; nature.time_past++) /*按时间跑圈*/
	{
		nature.turns(); /*一个回合内所有生物的动作*/
		nature.stillalive();
		if (nature.num_end.wolf == 0 && nature.num_end.sheep == 0 && nature.num_end.grass == 0) /*死光了就直接结束*/
		{
			break;
		}
		else
		{
			nature.num_end = {0, 0, 0, 0}; /*此处余量计算完了直接归零，避免重复计算*/
		}
	}
	nature.result(); /*总结*/
	return 0;
}